/**
 * 
 */
package com.shy.cms.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import com.google.gson.annotations.Expose;
import com.shy.base.entity.BaseEntity;
import com.shy.base.util.StringUtils;

import lombok.Data;


/**
 * <p>Title:Site</p>
 * <p>Description:站点信息實体 </p>
 * <p>Company:shy </p> 
 * @author H2013788
 * @date 2019年08月13日
 */
@Data
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@Entity
@Table(name = "cms_site_info")
public class Site extends BaseEntity {

	private static final long serialVersionUID = 1L;

    /** 站点名称 */
	@Expose
    @Column(name = "SITENAME")
    private String sitename;
    
    /** 域名 */
	@Expose
    @Column(name = "DOMAIN")
    private String domain;
    
    /** 标题 */
	@Expose
    @Column(name = "TITLE")
    private String title;
    
    /** 关键词 */
	@Expose
    @Column(name = "KEYWORD")
    private String keyword;
    
    /** 摘要 */
	@Expose
    @Column(name = "DESCRIPTION")
    private String description;
    
    /** 目录 */
	@Expose
    @Column(name = "SITEPATH")
    private String sitepath;
    
    /** 模板 */
	@Expose
    @Column(name = "TEMPLATE")
    private String template;
    
    /** ftp服務器IP */
    @Column(name = "FTP_SERVER")
    private String ftpServer;
    
    /** ftp服務器端口 */
    @Column(name = "FTP_PORT")
    private String ftpPort;
    
    /** ftp服務器用户名 */
    @Column(name = "FTP_USER")
    private String ftpUser;
    
    /** ftp服務器密码 */
    @Column(name = "FTP_PASSWORD")
    private String ftpPassword;
    
    /** oss accessKeyId */
    @Column(name = "OSS_ACCESSKEYID")
    private String ossAccessKeyId;
    
    /** oss accessKeySecret */
    @Column(name = "OSS_ACCESSKEYSECRET")
    private String ossAccessKeySecret;
    
    /** 節點地址，注意是http開頭 */
    @Column(name = "OSS_ENDPOINT")
    private String ossEndpoint;
    
    /** 示例名称 */
    @Column(name = "OSS_BUCKETNAME")
    private String ossBucketName;
    
    /** 发布类別1目录发布 2ftp发布 3oss发布 */
    @Column(name = "POST_TYPE")
    private Integer postType;
    
    /** 必应Token */
    @Column(name = "BING_TOKEN")
    private String bingToken;
    
    /** 百度提交token */
    @Column(name = "BAIDU_TOKEN")
    private String baiduToken;
    
    /** 提交地址前缀，请加上http或者https*/
    @Expose
    @Column(name = "BASE_URL")
    private String baseUrl;
    
    /** m端根地址 */
    @Expose
    @Column(name = "M_BASE_URL")
    private String mBaseUrl;
    
    /** 版本說明 */
    @Column(name = "COPYRIGHT")
    private String copyright;
    
    /** 站点类別，1資訊站  2小說站 */
    @Column(name = "SITE_TYPE")
    private Integer siteType;
    
    /** 快速收录，1www  2m */
    @Column(name = "SEO_TYPE")
    private Integer seoType;
    
    /** 搜索引擎验证信息 */
    @Column(name = "SEOMETA")
    private String seoMeta;
    
    /** 统计代码 */
    @Column(name = "TONGJI")
    private String tongji;
    
    /** 自动提交，默認0 */
    @Expose
    @Column(name = "AUTOPOST", columnDefinition="int default 0")
	protected Integer autoPost;
    
    /** 自动添加垃圾词，默認0 */
    @Expose
    @Column(name = "AUTO_EXTENDS_KEY", columnDefinition="int default 0")
	protected Integer autoExtendsKey;
    
    /**資訊生成目录針對siteType==2*/
    @Column(name = "NEWS_PATH")
    private String newsPath;
    
    /** 站点类別，1正向最新為小  2逆向最新為最大 */
    @Column(name = "LIST_DIRECT")
    private Integer listDirect;
    
    /** 资讯列表分页大小 */
    @Column(name = "PAGE_SIZE_ARTICLE")
    private Integer pageSizeArticle;
    
    /** 图书列表分页大小 */
    @Column(name = "PAGE_SIZE_BOOK")
    private Integer pageSizeBook;
    
    /** 神马账号 */
    @Column(name = "SMNAME")
    private String smName;
    
    /** 神马token */
    @Column(name = "SMTOKEN")
    private String smToken;
    
    /** 自动发文 */
    @Column(name = "AUTO_PUBLISH")
    private Integer autoPublish;
    
    /** 渠道号 */
    @Column(name = "CP_NO")
    private String cpNo;
    
    /** 畅读截流 */
    @Column(name = "BAIDUBOXAPP")
    private Integer baiduboxapp;
    
    /**
     * 绑定其他域名，和提交token应保持一直
     * 包含http:// 或 https://
     */
    @Column(name = "bind_domain")
    private String bindDomain;
    
    /**
     * 绑定token
     */
    @Column(name = "bind_token")
    private String bindToken;
    
    /**
     * 路径添加日期层，用于资讯详情、图书详情、章节详情，默认0不添加
     */
    @Column(name = "add_date_path")
    private Integer addDatePath;

	public String getBaseUrl() {
		if(StringUtils.isNotEmpty(baseUrl) && baseUrl.endsWith("/")) {
			baseUrl = baseUrl.substring(0, baseUrl.length() - 1);
		}
		return baseUrl;
	}

	public void setBaseUrl(String baseUrl) {
		this.baseUrl = baseUrl;
	}


	public String getmBaseUrl() {
		if(StringUtils.isNotEmpty(mBaseUrl) && mBaseUrl.endsWith("/")) {
			mBaseUrl = mBaseUrl.substring(0, mBaseUrl.length() - 1);
		}
		return mBaseUrl;
	}

	public void setmBaseUrl(String mBaseUrl) {
		this.mBaseUrl = mBaseUrl;
	}

	
    
}
